package cn.k7g.alloytest.mold.message;

import cn.k7g.alloy.mold.BaseMold;
import cn.k7g.alloy.mold.var.ConstVar;
import cn.k7g.alloytest.mold.var.StudentVar;
import cn.k7g.alloytest.mold.var.TeacherVar;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class PaymentNoticeAndLinkMold extends BaseMold {
    public PaymentNoticeAndLinkMold(Long stuId, Long teaId, Integer money) {
        addVar(new StudentVar("stu", stuId));
        addVar(new TeacherVar("teacher", teaId));
        addVar(new ConstVar("money", money));
        addVar(new ConstVar("date", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))));

        setContent("当前版本：#{GlobalFunc.getVersion()}  学生 #{link(stu, _stu)}, 通过老师 #{link(teacher, _teacher)} 缴纳学费 #{money + 1} 元, #{date}");
    }
}
